Пример #1
0
    // Use this for initialization
    void Start()
    {
        player                         = GameObject.FindGameObjectWithTag("Player");
        agent                          = GetComponent <NavMeshAgent>();
        puppet                         = GetComponent <PuppetScript>();
        protectiveAction               = ScriptableObject.CreateInstance <ReactiveGuard>();
        protectiveAction.animation     = animation;
        protectiveAction.puppet        = puppet;
        protectiveAction.GuardTimerMax = guardTimer;
        protectiveAction.playerPuppet  = player.GetComponent <PuppetScript>();
        protectiveAction.dances        = new List <string>();
        protectiveAction.dances.Add("Twerk");
        protectiveAction.dances.Add("Gangnam Style");
        protectiveAction.dances.Add("Robot");
        PopulateActions(phaseOneAttacks, ref phaseOne);
        if (!repeatActions)
        {
            PopulateActions(phaseTwoAttacks, ref phaseTwo);
        }
        else
        {
            PopulateActions(phaseOneAttacks, ref phaseTwo);
        }

        currentAction = phaseOne[0];
    }
Пример #2
0
	// Use this for initialization
	void Start()
	{
		player = GameObject.FindGameObjectWithTag("Player");
		agent = GetComponent<NavMeshAgent>();
		puppet = GetComponent<PuppetScript>();
		protectiveAction = ScriptableObject.CreateInstance<ReactiveGuard>();
		protectiveAction.animation = animation;
		protectiveAction.puppet = puppet;
		protectiveAction.GuardTimerMax = guardTimer;
		protectiveAction.playerPuppet = player.GetComponent<PuppetScript>();
		protectiveAction.dances = new List<string>();
		protectiveAction.dances.Add("Twerk");
		protectiveAction.dances.Add("Gangnam Style");
		protectiveAction.dances.Add("Robot");
		PopulateActions(phaseOneAttacks, ref phaseOne);
		if (!repeatActions)
			PopulateActions(phaseTwoAttacks, ref phaseTwo);
		else
			PopulateActions(phaseOneAttacks, ref phaseTwo);

		currentAction = phaseOne[0];
	}
Пример #3
0
    // Use this for initialization
    void Start()
    {
        if (windowTell == null)
        {
            Debug.LogWarning("I NEED A WINDOW OF OPPORTUNITY EFFECT IN Window Tell PLS KTHX");
        }
        player = GameObject.FindGameObjectWithTag("Player");
        agent  = GetComponent <NavMeshAgent>();
        puppet = GetComponent <PuppetScript>();
        FindMonitor();
        nextAction = 1;
        actions    = new List <Action>();
        foreach (ATTACK_TYPE attack in attacks)
        {
            switch (attack)
            {
            case ATTACK_TYPE.LEFT:
            {
                SlashLeft move = ScriptableObject.CreateInstance <SlashLeft>();
                move.animation = animation;
                move.puppet    = puppet;
                move.type      = Action.TYPE.SLASH;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.RIGHT:
            {
                SlashRight move = ScriptableObject.CreateInstance <SlashRight>();
                move.animation = animation;
                move.puppet    = puppet;
                move.type      = Action.TYPE.SLASH;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.TOP:
            {
                SlashTop move = ScriptableObject.CreateInstance <SlashTop>();
                move.animation = animation;
                move.puppet    = puppet;
                move.type      = Action.TYPE.SLASH;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.THRUST:
            {
                ThrustForward move = ScriptableObject.CreateInstance <ThrustForward>();
                move.animation = animation;
                move.puppet    = puppet;
                move.type      = Action.TYPE.SLASH;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.GUARD_LEFT:
            {
                GuardLeft move = ScriptableObject.CreateInstance <GuardLeft>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                move.type          = Action.TYPE.GUARD;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.GUARD_RIGHT:
            {
                GuardRight move = ScriptableObject.CreateInstance <GuardRight>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                move.type          = Action.TYPE.GUARD;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.GUARD_TOP:
            {
                GuardTop move = ScriptableObject.CreateInstance <GuardTop>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                move.type          = Action.TYPE.GUARD;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.REACTIVE_GUARD:
            {
                ReactiveGuard move = ScriptableObject.CreateInstance <ReactiveGuard>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                move.playerPuppet  = player.GetComponent <PuppetScript>();
                move.dances        = new List <string>();
                move.dances.Add("Twerk");
                move.dances.Add("Gangnam Style");
                move.dances.Add("Robot");
                move.type = Action.TYPE.GUARD;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.WINDOW_SHORT:
            {
                WindowOfOpportunity move = ScriptableObject.CreateInstance <WindowOfOpportunity>();
                move.WindowTell = windowTell;
                move.animation  = animation;
                move.puppet     = puppet;
                move.TimerMax   = shortTimer;
                move.type       = Action.TYPE.WINDOW;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.WINDOW_MEDIUM:
            {
                WindowOfOpportunity move = ScriptableObject.CreateInstance <WindowOfOpportunity>();
                move.WindowTell = windowTell;
                move.animation  = animation;
                move.puppet     = puppet;
                move.TimerMax   = mediumTimer;
                move.type       = Action.TYPE.WINDOW;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.WINDOW_LONG:
            {
                WindowOfOpportunity move = ScriptableObject.CreateInstance <WindowOfOpportunity>();
                move.WindowTell = windowTell;
                move.animation  = animation;
                move.puppet     = puppet;
                move.TimerMax   = longTimer;
                move.type       = Action.TYPE.WINDOW;
                actions.Add(move);
            }
            break;
            }
        }
        agent.stoppingDistance = 0.0f;

        currentAction = actions[0];
    }
Пример #4
0
    void PopulateActions(List <ATTACK_TYPE> attacks, ref List <Action> actions)
    {
        actions = new List <Action>();
        foreach (ATTACK_TYPE attack in attacks)
        {
            switch (attack)
            {
            case ATTACK_TYPE.LEFT:
            {
                SlashLeft move = ScriptableObject.CreateInstance <SlashLeft>();
                move.animation = animation;
                move.puppet    = puppet;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.RIGHT:
            {
                SlashRight move = ScriptableObject.CreateInstance <SlashRight>();
                move.animation = animation;
                move.puppet    = puppet;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.TOP:
            {
                SlashTop move = ScriptableObject.CreateInstance <SlashTop>();
                move.animation = animation;
                move.puppet    = puppet;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.THRUST:
            {
                ThrustForward move = ScriptableObject.CreateInstance <ThrustForward>();
                move.animation = animation;
                move.puppet    = puppet;
                actions.Add(move);
                break;
            }

            case ATTACK_TYPE.GUARD_LEFT:
            {
                GuardLeft move = ScriptableObject.CreateInstance <GuardLeft>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.GUARD_RIGHT:
            {
                GuardRight move = ScriptableObject.CreateInstance <GuardRight>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.GUARD_TOP:
            {
                GuardTop move = ScriptableObject.CreateInstance <GuardTop>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.REACTIVE_GUARD:
            {
                ReactiveGuard move = ScriptableObject.CreateInstance <ReactiveGuard>();
                move.animation     = animation;
                move.puppet        = puppet;
                move.GuardTimerMax = guardTimer;
                move.playerPuppet  = player.GetComponent <PuppetScript>();
                move.dances        = new List <string>();
                move.dances.Add("Twerk");
                move.dances.Add("Gangnam Style");
                move.dances.Add("Robot");
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.WINDOW_SHORT:
            {
                WindowOfOpportunity move = ScriptableObject.CreateInstance <WindowOfOpportunity>();
                move.animation = animation;
                move.puppet    = puppet;
                move.TimerMax  = shortTimer;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.WINDOW_MEDIUM:
            {
                WindowOfOpportunity move = ScriptableObject.CreateInstance <WindowOfOpportunity>();
                move.animation = animation;
                move.puppet    = puppet;
                move.TimerMax  = mediumTimer;
                actions.Add(move);
            }
            break;

            case ATTACK_TYPE.WINDOW_LONG:
            {
                WindowOfOpportunity move = ScriptableObject.CreateInstance <WindowOfOpportunity>();
                move.animation = animation;
                move.puppet    = puppet;
                move.TimerMax  = longTimer;
                actions.Add(move);
            }
            break;
            }
        }
    }