override public bool Merge(BaseCommand other) {
   if (base.Merge(other)) { return true; }
   if (m_Final) { return false; }
   ModifyLightCommand lightCommand = other as ModifyLightCommand;
   if (lightCommand == null || m_ModifiedLight != lightCommand.m_ModifiedLight) { return false; }
   m_EndColor = lightCommand.m_EndColor;
   m_EndRot = lightCommand.m_EndRot;
   m_Final = lightCommand.m_Final;
   return true;
 }
Example #2
0
        void SetLightColor(LightMode mode, Color color, bool noRecord = false)
        {
            ModifyLightCommand command = null;

            switch (mode)
            {
            case LightMode.Ambient:
                command = new ModifyLightCommand(mode, color, Quaternion.identity);
                break;

            case LightMode.Shadow:
            case LightMode.NoShadow:
                command = new ModifyLightCommand(mode, color,
                                                 App.Scene.GetLight((int)mode).transform.localRotation);
                break;
            }
            command.Redo();
            if (!noRecord)
            {
                SketchMemoryScript.m_Instance.RecordCommand(command);
            }
        }