本文整理汇总了C#中CharacterMotor类的典型用法代码示例。如果您正苦于以下问题:C# CharacterMotor类的具体用法?C# CharacterMotor怎么用?C# CharacterMotor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CharacterMotor类属于命名空间,在下文中一共展示了CharacterMotor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
public override void Start()
{
base.Start();
motor = GetComponent<CharacterMotor>();
animator = GetComponentInChildren<Animator>();
StartCoroutine("AI");
}
示例2: Start
// Use this for initialization
void Start()
{
Input.multiTouchEnabled = true;
characterMotorScript = objPlayer.GetComponent<CharacterMotor>();
characterJumpScript = objPlayer.GetComponent<CharacterJump2>();
characterShotScript = objPlayer.GetComponent<CharacterShot>();
}
示例3: Start
// Use this for initialization
void Start()
{
chMotor = GetComponent<CharacterMotor>();
tr = transform;
CharacterController ch = GetComponent<CharacterController>();
dist = ch.height/2; // calculate distance to ground
}
示例4: Start
// Use this for initialization
void Start()
{
controller = gameObject.transform.root.GetComponent<CharacterController>();
motor = gameObject.transform.root.GetComponent<CharacterMotor>();
inventory = gameObject.transform.root.GetComponent<Inventory>();
vitals = gameObject.transform.root.GetComponent<PlayerVitals>();
}
示例5: Awake
//setup
void Awake()
{
//create single floorcheck in centre of object, if none are assigned
if(!floorChecks)
{
floorChecks = new GameObject().transform;
floorChecks.name = "FloorChecks";
floorChecks.parent = transform;
floorChecks.position = transform.position;
GameObject check = new GameObject();
check.name = "Check1";
check.transform.parent = floorChecks;
check.transform.position = transform.position;
Debug.LogWarning("No 'floorChecks' assigned to PlayerMove script, so a single floorcheck has been created", floorChecks);
}
//assign player tag if not already
if(tag != "Player")
{
tag = "Player";
Debug.LogWarning ("PlayerMove script assigned to object without the tag 'Player', tag has been assigned automatically", transform);
}
//usual setup
mainCam = GameObject.FindGameObjectWithTag("MainCamera").transform;
dealDamage = GetComponent<DealDamage>();
characterMotor = GetComponent<CharacterMotor>();
rigid = GetComponent<Rigidbody>();
aSource = GetComponent<AudioSource>();
//gets child objects of floorcheckers, and puts them in an array
//later these are used to raycast downward and see if we are on the ground
floorCheckers = new Transform[floorChecks.childCount];
for (int i=0; i < floorCheckers.Length; i++)
floorCheckers[i] = floorChecks.GetChild(i);
}
示例6: Awake
// Use this for initialization
void Awake()
{
_Game = GameObject.Find("Game");
c_Game = _Game.GetComponentInChildren<Game>();
motor = GetComponent<CharacterMotor>();
}
示例7: Start
//Variables End___________________________________________________________
// Use this for initialization
void Start()
{
if(networkView.isMine == true)
{
myTransform = transform;
cameraHead = myTransform.FindChild("CameraHead");
motorScript = myTransform.GetComponent<CharacterMotor>();
//Access the PlayerStats script and get the player's max speed.
//This is their normal movement speed outside of the water.
GameObject gManager = GameObject.Find("GameManager");
PlayerStats statScript = gManager.GetComponent<PlayerStats>();
normalSpeed = statScript.maxSpeed;
}
else
{
enabled = false;
}
}
示例8: Awake
//setup
void Awake()
{
characterMotor = GetComponent<CharacterMotor>();
dealDamage = GetComponent<DealDamage>();
//avoid setup errors
if(tag != "Enemy")
{
tag = "Enemy";
Debug.LogWarning("'EnemyAI' script attached to object without 'Enemy' tag, it has been assign automatically", transform);
}
if(sightBounds)
{
sightTrigger = sightBounds.GetComponent<TriggerParent>();
if(!sightTrigger)
Debug.LogError("'TriggerParent' script needs attaching to enemy 'SightBounds'", sightBounds);
}
if(!sightBounds)
Debug.LogWarning("Assign a trigger with 'TriggerParent' script attached, to 'SightBounds' or enemy will not be able to see", transform);
if(attackBounds)
{
attackTrigger = attackBounds.GetComponent<TriggerParent>();
if(!attackTrigger)
Debug.LogError("'TriggerParent' script needs attaching to enemy 'attackBounds'", attackBounds);
}
else
Debug.LogWarning("Assign a trigger with 'TriggerParent' script attached, to 'AttackBounds' or enemy will not be able to attack", transform);
}
示例9: Start
// Use this for initialization
void Start () {
audioSource.clip = audio;
mouse = player.GetComponent<MouseLook>();
motor = player.GetComponent<CharacterMotor>();
triggered = false;
charControl = player.GetComponent<CharacterController>();
}
示例10: Awake
//setup
void Awake()
{
if(transform.tag != "Enemy")
{
//add kinematic rigidbody
if(!GetComponent<Rigidbody>())
gameObject.AddComponent<Rigidbody>();
GetComponent<Rigidbody>().isKinematic = true;
GetComponent<Rigidbody>().useGravity = false;
GetComponent<Rigidbody>().interpolation = RigidbodyInterpolation.Interpolate;
}
else
{
characterMotor = GetComponent<CharacterMotor>();
enemyAI = GetComponent<EnemyAI>();
}
//get child waypoints, then detach them (so object can move without moving waypoints)
foreach (Transform child in transform)
if(child.tag == "Waypoint")
waypoints.Add (child);
foreach(Transform waypoint in waypoints)
waypoint.parent = null;
if(waypoints.Count == 0)
Debug.LogError("No waypoints found for 'MoveToPoints' script. To add waypoints: add child gameObjects with the tag 'Waypoint'", transform);
}
示例11: Start
// Use this for initialization
protected virtual void Start()
{
SetInitialProperties();
characterController = GetComponent<CharacterController>();
control = GetComponent<Controller>();
motor = GetComponent<CharacterMotor>();
}
示例12: Start
void Start()
{
worldManager = (WorldManager)FindObjectOfType (typeof(WorldManager));
guiManager = (GUIManager)FindObjectOfType (typeof(GUIManager));
characterMotor=worldManager.getPlayer().GetComponent<CharacterMotor>();
}
示例13: OnEnable
// Use this for initialization
private void OnEnable()
{
myTransform = transform;
characterMotor = GetComponent<CharacterMotor>();
characterController = GetComponent<CharacterController>();
isFlying = false;
}
示例14: Start
// Use this for initialization
void Start()
{
motor = GetComponent(typeof(CharacterMotor)) as CharacterMotor;
if (motor==null) Debug.Log("Motor is null!!");
originalRotation = transform.localRotation;
}
示例15: Awake
void Awake()
{
cameraScript = GetComponent<MouseLook>();
cameraScript2 = camera.GetComponent<MouseLook>();
controllerScript = GetComponent<CharacterMotor>();
shotScript = GetComponent<Shot>();
if (photonView.isMine)
{
this.camera.camera.enabled=true;
cameraScript.enabled = true;
cameraScript2.enabled = true;
controllerScript.canControl = true;
shotScript.enabled=true;
}
else
{
this.camera.camera.enabled=false;
cameraScript.enabled = false;
cameraScript2.enabled = false;
controllerScript.canControl = false;
shotScript.enabled=false;
}
gameObject.name = gameObject.name + photonView.viewID.ID;
}