I thought I’d write this one up:
Scenario:
My game involves answering questions -
I have a countdown timer ‘Canvas’ controlled outside AC – But ‘one’ of the options (when the timer finishes) is to go to the “Review” inside the scene – and involves a scripted call to an AC ActionList. Others involve using Unity (5) SceneManagement to swap scenes..
So I needed the AC Namespace for my AC interaction option.
using UnityEngine.SceneManagement;
using AC;
Then throws the error :
CS0104: `SceneManager' is an ambiguous reference between `UnityEngine.SceneManagement.SceneManager' and `AC.SceneManager'
So , A Class conflict… (more like a bit of a low-key barney actually!)
So the solution appears to be aliasing …..
giving a usage(Précis) example:
using UESM = UnityEngine.SceneManagement;
using myAC = AC;
private myAC.ActionListAsset ReviewActionList;
case 4:
ReviewActionList = (myAC.ActionListAsset)Resources.Load("Review_AL") as myAC.ActionListAsset;
myAC.AdvGame.RunActionListAsset (ReviewActionList);
break;
case 5:
UESM.SceneManager.LoadScene (mySceneCount-1);
break;
Now – I searched for the unity error on Google & the forum – and got zero results : so it may be that nobody (AC wise) has created the same usage scenario type as I have : or that I am just such a C# ignoramus that people out there are saying “didn’t you know that!”
So here it is for other C# ignoramuses like me...
If anybody has a better way (other than suggesting I built my game differently : remember this is only a Précis..) I would love to learn :-)
Comments