News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • December 10, 2018, 09:32:47 AM

Login with username, password and session length

Author Topic: DoAction access destroyed object And GetControlButton type error  (Read 453 times)

Offline chenquanjun

  • Newbie
  • *
  • Posts: 1
DoAction access destroyed object And GetControlButton type error
« on: September 25, 2017, 01:29:41 PM »
1.Use QuickTap and set the gameobject DontDestroyOnLoad. When scenes change, DoAction trigger exception

Code: [Select]
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
HedgehogTeam.EasyTouch.QuickTap.DoAction (HedgehogTeam.EasyTouch.Gesture gesture) (at xx/EasyTouchBundle/EasyTouch/Plugins/Components/QuickTap.cs:77)
HedgehogTeam.EasyTouch.QuickTap.Update () (at xx/EasyTouchBundle/EasyTouch/Plugins/Components/QuickTap.cs:53)

2.GetControlButton use error type ETCJoystick
Code: [Select]
public static ETCButton GetControlButton(string ctrlName){
if (ETCInput.instance.controls.TryGetValue( ctrlName, out control)){
if (control.GetType() == typeof(ETCJoystick)){
ETCButton tmpctrl = (ETCButton)control;
return tmpctrl;
}
}

return null;
}

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: DoAction access destroyed object And GetControlButton type error
« Reply #1 on: September 28, 2017, 09:06:48 AM »
Hi,

1/ I just did the scene and I don't have error, can you send me some screenshot of object inspector, and your script please ?

2/ Can you give the error