Example #1
0
 void Awake()
 {
     AI       = this;
     MyPlayer = GameObject.FindGameObjectWithTag("Player");
     playerTR = MyPlayer.transform;
     playerSC = MyPlayer.GetComponent <sc_player> ();
 }
Example #2
0
    void Start()
    {
        AI       = sc_AICenter.AI;
        playerTR = AI.GetPlayerTR();
        scPlayer = playerTR.GetComponent <sc_player> ();
        areaMask = 1 << LayerMask.NameToLayer("Area");
        wallMask = 1 << LayerMask.NameToLayer("Wall");

        for (int i = 0; i < transform.childCount; i++)
        {
            Transform border = transform.GetChild(i);
            if (i < 2)
            {
                myBorder [i] = border.position.y;
            }
            else
            {
                myBorder [i] = border.position.x;
            }

            if (i != 2 && i != 3)
            {
                Destroy(border.gameObject);
            }
            else
            {
                Destroy(border.GetComponent <SpriteRenderer> ());
            }
        }
        StartCoroutine(CheckPlayerInArea());
        StartCoroutine(WaitSendArea());
    }
Example #3
0
 override protected void Start()
 {
     base.Start();
     scDialog = GetComponent <sc_NpcDialog> ();
     AI       = sc_AICenter.AI;
     playerTR = AI.GetPlayerTR();
     scPlayer = AI.GetPlayerSC();
 }
Example #4
0
    void Start()
    {
        AI       = sc_AICenter.AI;
        playerTR = AI.GetPlayerTR();
        followTR.Add(playerTR);
        focusBlack = GetComponentsInChildren <Image> ();
        StartCoroutine(ActiveFocusBlack(false, 0f));

        #region 處理不同比例解析度
        cam = Camera.main;
        if (cam.aspect < 1.7f)
        {
            float expectedHeight = Screen.width / 1.7f;
            ResolutionAdjust = expectedHeight / Screen.height;
            OrthoSizeCamera(camSize, 1f);
            SetFocusBlack(0f, 1f);
        }
        #endregion
    }