Beispiel #1
0
    public GameBall(BallData data, Action <string> action = null)
    {
        GameResModuel resModuel = GameStart.GetInstance().ResModuel;
        GameObject    ball      = resModuel.LoadResources <GameObject>(EResourceType.Ball, "GameBall");

        ball = CommonFunc.Instantiate(ball);
        if (ball != null)
        {
            m_ballAnim     = new GameBallAnim();
            m_ballInstance = ball.AddComponent <GameBallInstance>();
            m_ballInstance.SetBallRect(data.m_ballBoundArea);
            m_ballInstance.SetBounceAction(action);
        }
    }
Beispiel #2
0
 public void Destory()
 {
     GameObject.Destroy(m_ballInstance.gameObject);
     m_ballAnim         = null;
     m_outOfRangeAction = null;
 }