void OnSceneGUI()
    {
        ActionSlide action = target as ActionSlide;

        LevelBuilderCommon.Default5ActionButton(action.transform.position + new Vector3(0, 1.5f, 0), action);
        LevelBuilderCommon.DeleteButton(action);
    }
Esempio n. 2
0
 private void LinkActions(IAction linkThis, IAction toThis, Direction linkingDirection = Direction.None)
 {
     if (linkThis is ActionRun)
     {
         (linkThis as ActionRun).LinkTo((toThis as MonoBehaviour).gameObject, linkingDirection);
     }
     if (linkThis is ActionTranslate)
     {
         (linkThis as ActionTranslate).LinkTo((toThis as MonoBehaviour).gameObject);
     }
     if (linkThis is ActionSlide && toThis is ActionSlide)
     {
         ActionSlide slideRef = linkThis as ActionSlide;
         slideRef.slideEnd.Add((toThis as MonoBehaviour).gameObject);
         slideRef.slideStart = true;
         (toThis as ActionSlide).slideStart = false;
     }
     if (linkThis is ActionJump)
     {
         (linkThis as ActionJump).LinkTo((toThis as MonoBehaviour).gameObject);
     }
 }
Esempio n. 3
0
    bool parseAction(IAction action, Collider collider = null, bool trigger = false)
    {
        if (action is ActionPickUp)
        {
            ActionPickUp pickUpAction = (ActionPickUp)action;
            pickUpAction.executePickUp(this);
            return(true);
        }
        else if (action is ActionTriggerRun)
        {
            ActionTriggerRun runActionTrigger = (ActionTriggerRun)action;
            return(this.setRunDirection(runActionTrigger, runActionTrigger.getDirection()));
        }
        else if (action is ActionRun)
        {
            ActionRun actionRun = action as ActionRun;
            if (trigger)
            {
                return(this.setRunDirection(actionRun, actionRun.GetTriggerDirection()));
            }
            if (this.wannaBeDirection != this.direction)
            {
                return(this.setRunDirection(actionRun, this.wannaBeDirection));
            }
        }
        else if (action is ActionSafetyNetForRun)
        {
            if (this.wannaBeDirection != this.direction)
            {
                return(((ActionSafetyNetForRun)action).EarlyMove(this.wannaBeDirection));
            }
        }
        else if (action is ActionTranslate)
        {
            ActionTranslate translateAction = (ActionTranslate)action;
            this.transform.Translate(translateAction.getTranslateVector(), Space.World);
            return(true);
        }
        else if (action is ActionSlide)
        {
            ActionSlide slideAction = action as ActionSlide;
            if (this.boarding && slideAction.slideStart)
            {
                if (this.inAir)
                {
                    this.offsetAnimator.SetBool("Slide", true);
                }
                else
                {
                    this.boarding = false;
                    //this.SetupBoarding();
                }
            }
            else
            {
                this.offsetAnimator.SetBool("Slide", false);
                this.offsetAnimator.SetTrigger("StartHover");
            }
        }
        else if (action is ActionJump)
        {
            ActionJump jumpAction = action as ActionJump;
            if (this.boarding && this.jumping == -1f)
            {
                this.jumping            = 0f;
                this.startJumpingVector = this.transform.position;
                this.endJumpingVector   = jumpAction.GetTargetPosition();
            }
        }
        else if (action is ActionDeath)
        {
            this.die(((ActionDeath)action).getType());
        }

        return(false);
    }