Пример #1
0
    static public Cmd NewCmd <Cmd>(GameObject p_obj,
                                   float p_time            = 0,
                                   E_ObjCmdTimeUnit p_unit = E_ObjCmdTimeUnit.Sec,
                                   E_ObjCmdType p_temp     = E_ObjCmdType.Temp
                                   ) where Cmd : ObjCmdBase
    {
        Cmd _objCmd = p_obj.AddComponent <Cmd>();

        _objCmd.cmdType   = p_temp;
        _objCmd.delayUnit = p_unit;
        _objCmd.DoCmd(p_time);
        return(_objCmd);
    }
Пример #2
0
    static public Cmd NewCmd <Cmd, T>(GameObject p_obj,
                                      T p_arg,
                                      bool p_relatively       = false,
                                      float p_time            = 0,
                                      E_ObjCmdTimeUnit p_unit = E_ObjCmdTimeUnit.Sec,
                                      E_ObjCmdType p_temp     = E_ObjCmdType.Temp
                                      ) where Cmd : ObjCmdArgBase <T>
    {
        Cmd _objCmd = p_obj.AddComponent <Cmd>();

        _objCmd.cmdType    = p_temp;
        _objCmd.delayUnit  = p_unit;
        _objCmd.relatively = p_relatively;
        _objCmd.DoCmd(p_arg, p_time);
        return(_objCmd);
    }