コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (hexa == null)
     {
         hexa = Hexasphere.GetInstance("Hexasphere");
     }
 }
コード例 #2
0
    protected override void Start()
    {
        base.Start();
        if (planetSurface == null)
        {
            planetSurface = GameObject.Find("surfaceObj").transform;
        }
        if (hexa == null)
        {
            hexa = Hexasphere.GetInstance("Hexasphere");
        }
        if (hexaT == null)
        {
            hexaT = Hexasphere.GetInstance("Hexasphere").transform;
        }
        if (selfCanvas == null)
        {
            selfCanvas = GetComponent <Canvas>();
        }
        for (int i = 0; i < children.Count; i++)
        {
            children[i].GetComponent <Material>().DOFade(0f, 0f);
        }
        selfCanvas.enabled = false;

        /* for (int i = 0; i < transform.childCount; i++)
         * {
         *  Transform child = transform.getChild(i) as Transform;
         *
         *  children.Add(child);
         * }*/
    }
コード例 #3
0
ファイル: Unit.cs プロジェクト: ZacTallberg/unity_basics
 void Start()
 {
     if (selfAuto == null)
     {
         selfAuto = GetComponent <autoMovement>();
     }
     if (selfMove == null)
     {
         selfMove = GetComponent <MoveUnit>();
     }
     if (selfSend == null)
     {
         selfSend = GetComponent <sendUnit>();
     }
     if (hexa == null)
     {
         hexa = Hexasphere.GetInstance("Hexasphere");
     }
     //set height adjustment to keep object flush with surface
     heightAdjust = GetComponent <Renderer>().bounds.size.y;
     //get current tile at position, parent and set object alignment
     currentTile = hexa.GetTileAtLocalPos(transform.position);
     //hexa.ParentAndAlignToTile(gameObject, currentTile, heightAdjust, true, false, 1);
     //set initial state as idle
     stateMachine.ChangeState(new Idle(this));
 }
コード例 #4
0
 // Start is called before the first frame update
 void Start()
 {
     if (hexasphere == null)
     {
         hexasphere = Hexasphere.GetInstance("Hexasphere");
     }
     //Dictionary<GameObject, float> robotDistance = new Dictionary<GameObject, float>();
 }
コード例 #5
0
 //Initialization functions
 void Start()
 {
     if (hexa == null)
     {
         hexa = Hexasphere.GetInstance("Hexasphere");
     }
     if (menuObject == null)
     {
         menuObject = GameObject.Find("popUI").GetComponent <adjustMenu>();
     }
 }
コード例 #6
0
ファイル: grass.cs プロジェクト: ZacTallberg/unity_basics
 /// <summary>
 /// Start is called on the frame when a script is enabled just before
 /// any of the Update methods is called the first time.
 /// </summary>
 void Start()
 {
     if (hexa == null)
     {
         hexa = Hexasphere.GetInstance("Hexasphere");
     }
     if (setColor == null)
     {
         setColor = gameObject.GetComponent <SetSelfColor>();
     }
     height = gameObject.GetComponent <BoxCollider>().bounds.size.y / 2;
     setBasicAttributes();
     setSize();
 }
コード例 #7
0
 // Start is called before the first frame update
 void Start()
 {
     if (hexa == null)
     {
         hexa = Hexasphere.GetInstance("Hexasphere");
     }
     if (robotParent == null)
     {
         robotParent = GameObject.Find("Robots").GetComponent <Transform>();
     }
     if (robotParent.childCount > 0)
     {
         startNow = StartCoroutine(calculateAutoDestinations());
     }
 }
コード例 #8
0
 // Start is called before the first frame update
 void Start()
 {
     if (thisUnit == null)
     {
         thisUnit = gameObject.GetComponent <Unit>();
     }
     if (hexa == null)
     {
         hexa = Hexasphere.GetInstance("Hexasphere");
     }
     //  if (hexa == null) hexa = GameObject.Find("Hexasphere").GetComponent<Hexasphere>();
     currentTile     = thisUnit.currentTile;
     lastDestination = currentTile;
     //Moved this coroutine to it's own function
     // StartCoroutine(calculateAutoDestinations());
 }
コード例 #9
0
ファイル: MoveUnit.cs プロジェクト: ZacTallberg/unity_basics
 // Start is called before the first frame update
 void Start()
 {
     //Debug.Log("starting at moveUnit");
     if (hexa == null)
     {
         hexa = Hexasphere.GetInstance("Hexasphere");
     }
     if (thisUnit == null)
     {
         thisUnit = gameObject.GetComponent <Unit>();
     }
     if (autoMove == null)
     {
         autoMove = gameObject.GetComponent <autoMovement>();
     }
     //currentTile = thisUnit.currentTile;
 }