void Start() { billboard = GetComponentInChildren <Billboard> (); Debug.Assert(billboard != null); blockComponent = GetComponentInChildren <BlockComponent> (); Debug.Assert(blockComponent != null); if (blockComponent.surface != null) { var planet = Game.Instance.Planet; surfaces = new List <Surface> (planet.Terrian.FindSurfaces(blockComponent.surface, 5.0f)); var num = 7; for (var i = 0; i < num; i++) { if (surfaces.Count == 0) { break; } var index = UnityEngine.Random.Range(0, surfaces.Count - 1); var surface = surfaces [index]; surfaces.RemoveAt(index); planet.Create(Prefabs.Swordsman, surface); } } }
void Start() { blockComponent = GetComponent <BlockComponent> (); Debug.Assert(blockComponent != null); billboard = GetComponentInChildren <Billboard> (); Debug.Assert(billboard != null); }
public void Start() { character = GetComponent <Character> (); Debug.Assert(character != null); animator = GetComponentInChildren <Animator> (); Debug.Assert(animator != null); blockComponent = GetComponent <BlockComponent> (); Debug.Assert(blockComponent != null); movement = new Movement(character, blockComponent); targeting = new Targeting(character); animationEvents = animator.GetBehaviour <CritterAnimationEvents> (); Debug.Assert(animationEvents != null); }
public void Start() { blockComponent = GetComponent <BlockComponent> (); Debug.Assert(blockComponent != null); damage.sourceName = characterName; var animator = GetComponentInChildren <Animator> (); animator.SetAttackSpeed(animationInfo.attackSpeed); animator.SetWalkSpeed(animationInfo.walkSpeed); animator.SetIdleSpeed(animationInfo.idleSpeed); billboard = GetComponentInChildren <Billboard> (); Characters.Instance.Add(this); }
public Movement(Character character, BlockComponent blockComponent) { this.character = character; this.blockComponent = blockComponent; }