Example #1
0
        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);
                }
            }
        }
Example #2
0
 void Start()
 {
     blockComponent = GetComponent <BlockComponent> ();
     Debug.Assert(blockComponent != null);
     billboard = GetComponentInChildren <Billboard> ();
     Debug.Assert(billboard != null);
 }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
 public Movement(Character character, BlockComponent blockComponent)
 {
     this.character      = character;
     this.blockComponent = blockComponent;
 }