コード例 #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);
                }
            }
        }
コード例 #2
0
 void Start()
 {
     blockComponent = GetComponent <BlockComponent> ();
     Debug.Assert(blockComponent != null);
     billboard = GetComponentInChildren <Billboard> ();
     Debug.Assert(billboard != null);
 }
コード例 #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);
        }
コード例 #4
0
ファイル: Character.cs プロジェクト: will3/Cubical-planet
        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);
        }
コード例 #5
0
ファイル: Movement.cs プロジェクト: will3/Cubical-planet
 public Movement(Character character, BlockComponent blockComponent)
 {
     this.character      = character;
     this.blockComponent = blockComponent;
 }