예제 #1
0
        private void InitCommandList()
        {
            ConsoleDictionnary dico = GetComponent <ConsoleDictionnary>();

            cmdNames = new List <string>(dico.GetCommand());
            return;
        }
예제 #2
0
        public void Init(InteractiveBehaviour entity, IReadOnlyCollection <EntityVariable> variables, Transform target)
        {
            owner       = entity;
            this.target = target;

            if (hideName)
            {
                if (timeToCrypt > 0.0f)
                {
                    InvokeRepeating("CryptName", 0.0f, timeToCrypt);
                }
                else
                {
                    objName.text = "<color=#ffffffff>" + owner.Name.Crypt() + "</color>";
                }
            }
            else
            {
                objName.text = "<color=#ffffffff>" + owner.Name + "</color>";
            }

            console = FindObjectOfType <ConsoleLine>();
            dico    = console.GetComponent <ConsoleDictionnary>();

            // temporary fix to add objects without having a ref to the main camera
            if (mainCamera == null)
            {
                mainCamera = Camera.main;
            }

            console.AddOnWriteCommand(SetColor);
            console.AddOnActiveCommande(OnActiveConsole);

            InitTransform();
            InitVariable(variables);
        }