// constructor void Awake() { mCharaController = GetComponent <CharacterController>(); mRigController = GetComponent <RigidbodyController>(); if (mRigController != null) { mRigController.mAutoUserControl = false; NetworkRigidbody nrb = GetComponent <NetworkRigidbody>(); } mFwdLerp = this.transform.forward; mMeleeColliderNetBhv = mMeleeCollider.GetComponent <MeleeColliderNetBhv>(); mMeleeColliderNetBhv.mOwner = this.gameObject; mMeleeCollider.gameObject.SetActive(false); mDbgTxt = GetComponentInChildren <TextMesh>(true); #if USE_RIGID mRigidbody = GetComponent <Rigidbody>(); if (mRigidbody != null) { _isRigidbody = false; } #endif Physics.IgnoreCollision(mSwordBhv.GetComponent <Collider>(), GetComponent <Collider>()); }
protected void Start() { controller = GetComponent <RigidbodyController>(); player = controller.player; changeSource = (AudioSource)gameObject.AddComponent <AudioSource>(); changeSound = (AudioClip)Resources.Load("bookChange"); }
protected void Start() { controller = GetComponent <RigidbodyController>(); player = controller.player; multiSource = (AudioSource)gameObject.AddComponent <AudioSource>(); multiSound = (AudioClip)Resources.Load("trippleShot"); }
public void RegisterPlayer(RigidbodyController controller) { _players.Add(controller); if (_players.Count > 1) { _realGame = true; } }
protected void Start() { controller = GetComponent <RigidbodyController>(); player = controller.player; dashSource = (AudioSource)gameObject.AddComponent <AudioSource>(); dashSound = (AudioClip)Resources.Load("dash"); base.Start(); }
void Awake() { cpm = GameObject.FindWithTag("cpm"); mgr = cpm.GetComponent <CheckpointManager>(); pl = GameObject.FindWithTag("Player"); pls = pl.GetComponent <RigidbodyController>(); tl = pls.Trail.GetComponent <TrailRenderer>(); }
protected void Start() { controller = GetComponent <RigidbodyController>(); player = controller.player; InvisAudio = (AudioSource)gameObject.AddComponent <AudioSource>(); InvisClipStart = (AudioClip)Resources.Load("invisibleIn"); InvisClipEnd = (AudioClip)Resources.Load("InvisibleOut"); base.Start(); }
private void Start() { rb = GetComponent <Rigidbody>(); rb.velocity = Vector3.zero; controller = GetComponent <RigidbodyController>(); controller.controlledByAgent = true; startPos = transform.position; startRotation = transform.rotation; milestones = milestonesParent.GetComponentsInChildren <TrackMilestone>(); goal = FindObjectOfType <Goal>(); target = goal; if (showGUI) { debugGUI = new DebugGUI(); } }
protected void Start() { controller = GetComponent <RigidbodyController>(); player = controller.player; ghostObject = Instantiate(ghostPrefab, transform.position, transform.rotation); recallSource = (AudioSource)gameObject.AddComponent <AudioSource>(); recallSound = (AudioClip)Resources.Load("teleport"); ghostObject.GetComponent <SpriteRenderer>().sprite = GetComponent <SpriteRenderer>().sprite; particles = Instantiate(ParticlePrefab, transform) .GetComponent <ParticleSystem>(); particles.GetComponent <Renderer>().material.mainTexture = controller.playerSprites[(int)controller.player.PlayerColor].texture; base.Start(); }
void OnTriggerEnter2D(Collider2D other) { RigidbodyController character = other.GetComponent <RigidbodyController>(); switch (State) { case BookState.Grounded: if (character != null && !character.HasBook()) { State = BookState.Held; _heldBy = other.gameObject; transform.parent = other.transform; transform.localPosition = new Vector3(0, 1, 0); GetComponent <CircleCollider2D>().enabled = false; character.GetBook(this); } break; case BookState.Held: break; case BookState.Thrown: if (character != null) { if (character.gameObject != _heldBy) { character.HitByBook(this); Explode(); } } else if (other.GetComponent <BookBehavior>() == null) { Explode(); } if (transform.position.magnitude > 20) { Destroy(gameObject); } break; default: throw new ArgumentOutOfRangeException(); } }
void Awake() { rc = gameObject.GetComponent <RigidbodyController>(); }
// Use this for initialization void Start() { controller = GetComponent <RigidbodyController>(); }
private void Start() { _playerController = GetComponent <RigidbodyController>(); }
protected virtual void GetRequiredComponents() { controller = GetComponent <RigidbodyController>(); }
void Awake() { player = GameObject.FindWithTag("Player"); pls = player.GetComponent <RigidbodyController>(); tl = pls.Trail.GetComponent <TrailRenderer>(); }
void Awake() { rigidbodyController = GetComponent <RigidbodyController>(); navMeshAgent = GetComponent <NavMeshAgent>(); animator = GetComponent <Animator>(); }