Exemple #1
0
    public void setInfo(StadiumGraphWorker graph, FishData fd, long delay)
    {
        fish       = transform.Find(SAAppConfig.Language + "_" + fd.fishID + "s");
        stfish     = STFish.getMap()[fd.fishID];
        life       = stfish.Life;
        this.graph = graph;
        this.fd    = fd;
        float pos;
        float npos;

        isRight = fd.begin < 0;
        if (isRight)//从右侧出发
        {
            pos  = SAACollection.height * -fd.begin / 20 - SAACollection.halfHeight;
            npos = SAACollection.height * fd.end / 20 - SAACollection.halfHeight;
            transform.position = new Vector3(SAACollection.halfWidth, pos, 0);
            transform.LookAt(new Vector3(-SAACollection.halfWidth, npos, 0));
        }
        else
        {
            pos  = SAACollection.height * fd.begin / 20 - SAACollection.halfHeight;
            npos = SAACollection.height * -fd.end / 20 - SAACollection.halfHeight;
            transform.position = new Vector3(-SAACollection.halfWidth, pos, 0);
            transform.LookAt(new Vector3(SAACollection.halfWidth, npos, 0));
        }
        //矫正位置
        //transform.Translate(Vector3.forward * stfish.Speed * delay / 1000);
    }
Exemple #2
0
        private void addScoreHandler(SAFactoryEvent action)
        {
            FishData fd = (FishData)action.Body;

            lblScore.text = "分数 : " + STFish.getMap()[fd.fishID].Coin;
        }