Example #1
0
    private void Start()
    {
        this.animator.Play("born");
        if (DataReader <DiaoLuoMoXingBiao> .Contains(this.ModelID))
        {
            DiaoLuoMoXingBiao diaoLuoMoXingBiao = DataReader <DiaoLuoMoXingBiao> .Get(this.ModelID);

            BillboardManager.Instance.AddBillboardsInfo(101, base.get_transform(), (float)DataReader <DiaoLuoMoXingBiao> .Get(this.ModelID).height_HP, (long)this.Index, false, true, true);
            HeadInfoManager.Instance.SetName(101, (long)this.Index, this.ItemName);
        }
    }
Example #2
0
    public static RealDrop CreateRealDrop(int theIndex, int theModelID, string theItemName, Vector3 originPoint, Vector3 waitPoint, int waitFxID, int collectTextID)
    {
        if (!DataReader <DiaoLuoMoXingBiao> .Contains(theModelID))
        {
            return(null);
        }
        DiaoLuoMoXingBiao diaoLuoMoXingBiao = DataReader <DiaoLuoMoXingBiao> .Get(theModelID);

        GameObject gameObject = GameObjectLoader.Instance.Get(diaoLuoMoXingBiao.path);

        if (gameObject == null)
        {
            return(null);
        }
        RealDrop realDrop = gameObject.AddUniqueComponent <RealDrop>();

        realDrop.Index    = theIndex;
        realDrop.ModelID  = theModelID;
        realDrop.ItemName = theItemName;
        realDrop.animator = realDrop.GetComponentInChildren <Animator>();
        realDrop.get_gameObject().set_layer(LayerSystem.NameToLayer("Gear"));
        realDrop.get_transform().set_parent(RealDrop.DropPool.get_transform());
        realDrop.get_transform().set_position(originPoint);
        if (originPoint.x == waitPoint.x && originPoint.z == waitPoint.z)
        {
            realDrop.currentState           = RealDrop.RealDropState.Wait;
            realDrop.waitPosition           = originPoint;
            realDrop.flyToWaitPositionSpeed = Vector3.get_zero();
        }
        else
        {
            realDrop.currentState           = RealDrop.RealDropState.FlyToWait;
            realDrop.waitPosition           = MySceneManager.GetTerrainPoint(waitPoint.x, waitPoint.z, waitPoint.y);
            realDrop.flyToWaitPositionSpeed = (realDrop.waitPosition - originPoint) / RealDrop.FlyToWaitPositionDefaultTime;
        }
        realDrop.waitFxModelID = waitFxID;
        realDrop.waitCollider  = realDrop.GetComponent <BoxCollider>();
        realDrop.waitCollider.set_enabled(false);
        RealDrop.allRealDrop.Add(realDrop);
        return(realDrop);
    }
Example #3
0
    public static FakeDrop CreateFakeDrop(int modelID, Vector3 originPoint, Vector3 waitPoint, int waitFxID, int flyToEntityFxID)
    {
        DiaoLuoMoXingBiao diaoLuoMoXingBiao = DataReader <DiaoLuoMoXingBiao> .Get(modelID);

        if (diaoLuoMoXingBiao == null)
        {
            return(null);
        }
        GameObject gameObject = GameObjectLoader.Instance.Get(diaoLuoMoXingBiao.path);

        if (gameObject == null)
        {
            return(null);
        }
        FakeDrop fakeDrop = gameObject.AddUniqueComponent <FakeDrop>();

        fakeDrop.animator = fakeDrop.GetComponentInChildren <Animator>();
        fakeDrop.get_gameObject().set_layer(LayerSystem.NameToLayer("Gear"));
        fakeDrop.get_transform().set_parent(FakeDrop.DropPool.get_transform());
        fakeDrop.get_transform().set_position(originPoint);
        if (originPoint.x == waitPoint.x && originPoint.z == waitPoint.z)
        {
            fakeDrop.currentState           = FakeDrop.FakeDropState.Wait;
            fakeDrop.waitPosition           = originPoint;
            fakeDrop.flyToWaitPositionSpeed = Vector3.get_zero();
        }
        else
        {
            fakeDrop.currentState           = FakeDrop.FakeDropState.FlyToWait;
            fakeDrop.waitPosition           = MySceneManager.GetTerrainPoint(waitPoint.x, waitPoint.z, waitPoint.y);
            fakeDrop.flyToWaitPositionSpeed = (fakeDrop.waitPosition - originPoint) / FakeDrop.FlyToWaitPositionDefaultTime;
        }
        fakeDrop.waitFxModelID = waitFxID;
        fakeDrop.waitCollider  = fakeDrop.GetComponent <BoxCollider>();
        fakeDrop.waitCollider.set_enabled(false);
        fakeDrop.flyToEntityFxModelID = flyToEntityFxID;
        FakeDrop.allFakeDrop.Add(fakeDrop);
        return(fakeDrop);
    }