Exemplo n.º 1
0
 void HandleFinishMovePlayerByPath()
 {
     if (ShootPlayerPath.NextPlayerPath)
     {
         ShootPlayerPath   = ShootPlayerPath.NextPlayerPath;
         IsActiveRunPlayer = false;
         ActiveRunPlayer();
     }
 }
    void OnDrawGizmosSelected()
    {
        if (!enabled)
        {
            return;
        }

        Transform parTran = transform.parent;

        if (parTran == null)
        {
            return;
        }

        CartoonShootPlayerPath pathScript = parTran.GetComponent <CartoonShootPlayerPath>();

        pathScript.DrawPath();
    }
Exemplo n.º 3
0
    void ActiveRunPlayer()
    {
        if (ShootPlayerPath == null)
        {
            Debug.LogError("ActiveRunPlayer -> ShootPlayerPath was null!");
            return;
        }

        if (IsActiveRunPlayer)
        {
            return;
        }
        IsActiveRunPlayer = true;
        Debug.Log("ActiveRunPlayer...");

        PlayerObj  = gameObject;
        PlayerTran = transform;

        if (pathCount <= 0)
        {
            CartoonShootCamCtrl.GetInstance().CheckGenSuiCamTranStartGame();
            if (ShootPlayerMark != null)
            {
                MarkCurrentIndex = ShootPlayerMark.MarkIndex;
                ShootPlayerPath  = ShootPlayerMark.ShootPlayerPath;
                PlayerPathTran   = ShootPlayerPath.transform;
            }
            else
            {
                MarkCurrentIndex = 0;
                PlayerPathTran   = ShootPlayerPath.transform;
            }
            PlayerTran.position = PlayerPathTran.GetChild(MarkCurrentIndex).position;
            PlayerTran.rotation = PlayerPathTran.GetChild(MarkCurrentIndex).rotation;
        }
        else
        {
            MarkCurrentIndex = 0;
            PlayerPathTran   = ShootPlayerPath.transform;
        }

        MovePlayerByShootPath();
        pathCount++;
    }