public override void InitEquipment(Pathea.PeEntity entity, ItemAsset.ItemObject itemObj)
    {
        base.InitEquipment(entity, itemObj);
        m_Equip.SetEnergySheild(this);
        m_EnergyAttr = m_ItemObj.GetCmpt <ItemAsset.Energy>();

        if (null != m_EnergyAttr)
        {
            m_Entity.SetAttribute(AttribType.Shield, m_EnergyAttr.energy.current);
            m_EnergyAttr.SetMax(m_MaxEnergy);
        }
        m_Entity.SetAttribute(AttribType.ShieldMax, m_MaxEnergy);

        lastUsedTime = Time.time;

        m_Time             = new UTimer();
        m_Time.ElapseSpeed = -1f;
        m_Time.Second      = GameConfig.NetUpdateInterval;
        m_LastNetValue     = enCurrent;

        if (!m_Active)
        {
            DeactiveSheild();
        }
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        lastFishCool      = UTimer.Initialize(lastFishTimer, this, OnLastFishTimer);
        afterLastFishCool = UTimer.Initialize(timeAfterLastFish, this, OnAfterLastFish);

        lastFishCool.start();
    }
Пример #3
0
 public AttFilter_Time(float intervalTime)
 {
     mIntervalTime      = intervalTime;
     mTimer             = new UTimer();
     mTimer.ElapseSpeed = -1;
     mTimer.Second      = mIntervalTime;
 }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     spiderReelAudio = FMODUnity.RuntimeManager.CreateInstance(spiderMoveAudioEvent);
     isMoving        = false;
     spiderReelAudio.start();
     spiderReelAudio.setPaused(true);
     timerIdle = UTimer.Initialize(timeToBeIdle, this, StartIdle);
 }
Пример #5
0
 public Action_HandChangeEquipHold()
 {
     if (null == m_FixErrorTimer)
     {
         m_FixErrorTimer             = new UTimer();
         m_FixErrorTimer.ElapseSpeed = -1f;
     }
 }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        Timer             = new PETimer();
        Timer.ElapseSpeed = 0;

        PlayTime             = new UTimer();
        PlayTime.ElapseSpeed = 1;
    }
Пример #7
0
    public override void OnDragOut()
    {
        base.OnDragOut();

        mNoticeTimer             = new UTimer();
        mNoticeTimer.ElapseSpeed = -1f;
        mNoticeTimer.Second      = 1;
    }
Пример #8
0
    // Start is called before the first frame update
    void Start()
    {
        bobberTimer = UTimer.Initialize(0.1f, this, setBobberKinematicOnFalse);

        bendyRod.GetComponent <Renderer>().enabled = false;
        setCableComponentValues();
        setBendySpringJointNormalState();
        unsetBendyPhysic();
    }
Пример #9
0
    // Start is called before the first frame update
    void Start()
    {
        fishingManagement      = GetComponent <FishingManagement>();
        poseFishing            = GetComponent <RepresentationPositionFishing>();
        hapticDistance         = GetComponent <HapticDistance>();
        hapticDistance.enabled = false;

        fishEscapingTimer = UTimer.Initialize(5, this, moveEscapingFish);
    }
Пример #10
0
    // Start is called before the first frame update
    void Start()
    {
        fishEscapingTimer = UTimer.Initialize(moveFrequence, this, moveEscapingFish);
        splashTimer       = UTimer.Initialize(timeBeforeColorSplash, this, CreateSplash);
        Vector3 force = new Vector3(0, 250, 0) * GetComponent <Rigidbody>().mass;

        GetComponent <Rigidbody>().AddForce(force);
        fishEscapingTimer.start();
    }
Пример #11
0
 public override void InitEquipment(Pathea.PeEntity entity, ItemAsset.ItemObject itemObj)
 {
     base.InitEquipment(entity, itemObj);
     m_Equip.SetJetPackLogic(this);
     m_ItemAttr         = itemObj.GetCmpt <ItemAsset.JetPkg>();
     m_Time             = new UTimer();
     m_Time.ElapseSpeed = -1f;
     m_Time.Second      = GameConfig.NetUpdateInterval;
     m_LastNetValue     = enCurrent;
 }
    private void Awake()
    {
        //timer to activate immediately, the neighbour sleeps unitl the end of the timer
        timerBetweenRestSigne = UTimer.Initialize(settings.InitialTimeBetween2Checks, this, Checking);

        //timer to activate after the last one, the neighbour switch on its sign and let it visible until the end of the timer
        timerBetweenSigneComing = UTimer.Initialize(settings.InitialTimeDtection, this, Coming);

        //timer to activate after the last one, the neighbour check if the player is making some noise until the end of the timer
        timerBetweenComingDeparture = UTimer.Initialize(settings.InitialReactionTime, this, Departure);
    }
Пример #13
0
 protected override void InitWindow()
 {
     if (mInit)
     {
         return;
     }
     base.InitWindow();
     mTimer             = new UTimer();
     mTimer.ElapseSpeed = 1;
     mTimer.Second      = 0;
     mInit = true;
 }
Пример #14
0
 public override void InitEquipment(Pathea.PeEntity entity, ItemAsset.ItemObject itemObj)
 {
     base.InitEquipment(entity, itemObj);
     m_Energy = m_ItemObj.GetCmpt <ItemAsset.Energy>();
     if (null != m_Energy)
     {
         m_Entity.SetAttribute(AttribType.EnergyMax, m_Energy.valueMax);
         m_Entity.SetAttribute(AttribType.Energy, m_Energy.floatValue.current);
     }
     m_LastNetValue     = m_Entity.GetAttribute(AttribType.Energy);
     m_Time             = new UTimer();
     m_Time.ElapseSpeed = -1f;
     m_Time.Second      = GameConfig.NetUpdateInterval;
 }
Пример #15
0
    // Use this for initialization
    new void Start()
    {
        base.Start();

        m_Info = CSInfoMgr.m_AssemblyInfo;

        CreateEnergySheild();

        m_CurEnergySheild.onEnterTrigger += OnEnterTrigger;
        m_CurEnergySheild.onExitTrigger  += OnExitTrigger;

        m_triggerTimer             = new UTimer();
        m_triggerTimer.ElapseSpeed = 1;
    }
Пример #16
0
        public static string GetStrHhMm(this UTimer t)
        {
            UTimer.TimeStruct ts = t.TickToTimeStruct(t.Tick);
            int h = ts.Hour;
            int m = ts.Minute;

            s_strBuff.Length = 0;
            s_strBuff.Append((char)('0' + (h / 10)));
            s_strBuff.Append((char)('0' + (h % 10)));
            s_strBuff.Append(':');
            s_strBuff.Append((char)('0' + (m / 10)));
            s_strBuff.Append((char)('0' + (m % 10)));
            return(s_strBuff.ToString());
        }
Пример #17
0
    UTimer CreateTimerVo(float delay, Action <object[]> action, int loop, bool ignoreTimeScale, params object[] args)
    {
        UTimer actionVo = new UTimer();

        actionVo.action          = action;
        actionVo.args            = args;
        actionVo.ignoreTimeScale = ignoreTimeScale;
        actionVo.delay           = delay;
        actionVo.loop            = loop;
        if (ignoreTimeScale)
        {
            actionVo.time = Time.realtimeSinceStartup;
        }
        else
        {
            actionVo.time = Time.time;
        }
        return(actionVo);
    }
Пример #18
0
    UTimer CreateTimerVo(float delay, Action action, int loop, bool ignoreTimeScale, bool isClearWhenChangeMap)
    {
        UTimer actionVo = new UTimer();

        actionVo.simpleAction         = action;
        actionVo.args                 = null;
        actionVo.ignoreTimeScale      = ignoreTimeScale;
        actionVo.delay                = delay;
        actionVo.loop                 = loop;
        actionVo.isClearWhenChangeMap = isClearWhenChangeMap;
        if (ignoreTimeScale)
        {
            actionVo.time = Time.realtimeSinceStartup;
        }
        else
        {
            actionVo.time = Time.time;
        }
        return(actionVo);
    }
Пример #19
0
 public static void Invoke(Action a, TimeMode mode, float time)
 {
     if (time == 0f)
     {
         a();
     }
     else
     {
         var timer = new UTimer(mode);
         timer.Duration      = time;
         timer.TimerElapsed += () =>
         {
             timer.Stop();
             if (a != null)
             {
                 a();
             }
             timer = null;
         };
         timer.Start();
     }
 }
Пример #20
0
    public override void InitEquipment(PeEntity entity, ItemAsset.ItemObject itemObj)
    {
        base.InitEquipment(entity, itemObj);
        m_Equip.SetEnergyGunLogic(this);

        m_ItemAmmoAttr = itemObj.GetCmpt <ItemAsset.GunAmmo>();
        if (null != m_ItemAmmoAttr)
        {
            if (null != m_Magazine)
            {
                if (m_ItemAmmoAttr.count < 0)
                {
                    m_ItemAmmoAttr.count = (int)magazineSize;
                }

                m_Magazine.m_Value = m_ItemAmmoAttr.count;
            }
        }

        m_Time             = new UTimer();
        m_Time.ElapseSpeed = -1f;
        m_Time.Second      = GameConfig.NetUpdateInterval;
        m_LastNetValue     = enCurrent;
    }
Пример #21
0
 public void MinusTime(UTimer timer)
 {
     m_Tick -= timer.m_Tick;
 }
Пример #22
0
 // Start is called before the first frame update
 void Start()
 {
     timerOnFil = UTimer.Initialize(tempsSurLeFil, this, debutDebatFil);
     //moucheVole = FMODUnity.RuntimeManager.CreateInstance(moucheVoleEvent);
     //moucheVole.start();
 }
Пример #23
0
 // Start is called before the first frame update
 void Start()
 {
     clignotement = UTimer.Initialize(frequenceIndication, this, startClignotement, true);
 }
Пример #24
0
 public override void OnCreate()
 {
     base.OnCreate();
     mInstance = this;
     m_UTimer  = new UTimer();
 }
Пример #25
0
    // Start is called before the first frame update
    void Start()
    {
        FishTimer = UTimer.Initialize(0, this, StartShoeFish);

        //UnfishTimer = UTimer.Initialize(0, this, ReleaseFish);
    }
Пример #26
0
 void Awake()
 {
     timerCops     = UTimer.Initialize(timeBeforeArrieeDesCops, this, LaunchPoliceAnimation);
     timerEndScene = UTimer.Initialize(timeSceneGameOver, this, changeScene);
 }
Пример #27
0
    void ChangeArvhive(Pathea.PeGameSummary summary)
    {
        if (summary != null)
        {
            switch (summary.sceneMode)
            {
            case Pathea.PeGameMgr.ESceneMode.Story:
                mGametypeText.text = PELocalization.GetString(10007);
                //mSeedIDText.text = "Unknown";
                //mSeedTitleText.text = "Area:";
                mSeedRoot.SetActive(false);
                break;

            case Pathea.PeGameMgr.ESceneMode.Adventure:
                mGametypeText.text  = PELocalization.GetString(10008);
                mSeedIDText.text    = summary.seed;
                mSeedTitleText.text = PELocalization.GetString(8000361) + ":";
                mSeedRoot.SetActive(true);
                break;

            case Pathea.PeGameMgr.ESceneMode.Build:
                mGametypeText.text  = PELocalization.GetString(10009);
                mSeedIDText.text    = summary.seed;
                mSeedTitleText.text = PELocalization.GetString(8000361) + ":";
                mSeedRoot.SetActive(true);
                break;

            case Pathea.PeGameMgr.ESceneMode.Custom:
                mGametypeText.text  = PELocalization.GetString(10222);
                mSeedIDText.text    = PELocalization.GetString(8000558);
                mSeedTitleText.text = PELocalization.GetString(8000557);
                mSeedRoot.SetActive(false);
                break;

            default:
                break;
            }
            mInfoGrid.repositionNow = true;

            UTimer tmp_playtimer = new UTimer();
            tmp_playtimer.Second = summary.playTime;
            if (tmp_playtimer.Day < 1)
            {
                mPlayTimeText.text = tmp_playtimer.FormatString("hh:mm:ss");
            }
            else
            {
                mPlayTimeText.text = tmp_playtimer.FormatString("D days hh:mm:ss");
            }

            PETimer tmp_gametimer = PETimerUtil.GetTmpTimer();
            tmp_gametimer.Second = summary.gameTime;
            mGameTimeText.text   = tmp_gametimer.FormatString("hh:mm:ss AP");
            mSaveTex.enabled     = true;
            mSaveTex.mainTexture = (summary.screenshot != null) ?  summary.screenshot : mAutoTex;
        }
        else
        {
            mGametypeText.text = "";
            mSeedIDText.text   = "";
//			mBorimText.text = "";
            mPlayTimeText.text   = "";
            mGameTimeText.text   = "";
            mSaveTex.enabled     = false;
            mSaveTex.mainTexture = null;
        }
    }
Пример #28
0
 public void AddTime(UTimer timer)
 {
     m_Tick += timer.m_Tick;
 }
Пример #29
0
    //timer : the time took by the timer to switch <finished> to true
    //obj : need a monobehaviour reference to lanch the StartCoroutine function, almost every time 'this' (i know, a little ugly)
    //debug : if you want to see the timer developpement
    public static UTimer Initialize(float time, MonoBehaviour obj, UnityAction function, bool debug = false)
    {
        UTimer returnVal = new UTimer(time, obj, function, debug);

        return(returnVal);
    }
Пример #30
0
 public Stopwatch()
 {
     name  = "";
     timer = new UTimer();
     timer.Reset();
 }