Forum rules - please read before posting.

[Solved] Custom action from template

edited August 2014 in Technical Q&A
Hi, 
I'm trying to implement a custom action and call it in a cutscene.

The action: "ActionInventoryTest.cs" 
I placed it in the folder /scripts/actions

I added this line: title = "Inventory: Test";

So I tried to add this action to a cutscene, just to test but nothing appear (I refreshed and I quit and re-open unity just to be sure).

I tried also to select "Custom" from action types, but it raises a warning:
"No Actions found in selected category"

I'm a beginner, so I could be doing a very simple mistake. 

What am I doing wrong?

Thank you very much... and sorry if I'm asking too many questions, but I'm trying to learn.

The entire action code is here:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using AC;

#if UNITY_EDITOR
using UnityEditor;

[System.Serializable]
public class ActionInventoryTest : Action
{
// Declare variables here
public bool testValue = false;
public ActionInventoryTest ()
{
this.isDisplayed = true;
title = "Inventory: Test";
}
override public float Run ()
{
Debug.Log ("This is a test");

if (!isRunning)
{
isRunning = true;
return defaultPauseTime;
}
else
{
isRunning = false;
return 0f;
}
}
#if UNITY_EDITOR

override public void ShowGUI ()
{
// Action-specific Inspector GUI code here
AfterRunningOption ();
}

public override string SetLabel ()
{
// Return a string used to describe the specific action's job.
string labelAdd = "";
return labelAdd;
}

}

Comments

  • edited August 2014
    Ok... solved.

    I thought that I had to refresh unity.
    Now I've found that I had to refresh the Action Manager.

    All is working.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.